import Simplification.Simplification;
import Syntaxe.Fraction;
import Syntaxe.Matrice;
import Syntaxe.Simplexe;
import Syntaxe.Vecteur;

public class test3 {

	public static void main(String[] args) {
		//page61 ChenBaolin
		Fraction[][] matrice= new Fraction[3][4];
		matrice[0][0] = new Fraction(-1);
		matrice[0][1] = new Fraction(-1);
		matrice[0][2] = new Fraction(2);
		matrice[0][3] = new Fraction(-10);
		matrice[1][0] = new Fraction(-2);
		matrice[1][1] = new Fraction(1);
		matrice[1][2] = new Fraction(-4);
		matrice[1][3] = new Fraction(-8);
		matrice[2][0] = new Fraction(1);
		matrice[2][1] = new Fraction(-2);
		matrice[2][2] = new Fraction(4);
		matrice[2][3] = new Fraction(-4);
		
		Matrice m = new Matrice(matrice);
		//double[][] md=m.transToDouble();
		//Simplification sim=new Simplification(md);
		Fraction[] f= new Fraction[4];
		f[0]=new Fraction(1);
		f[1]=new Fraction(-2);
		f[2]=new Fraction(1);
		f[3]=new Fraction(0);
		Simplexe sim=Simplification.matriceIni(m, f);
		m.AfficheMatrice();
		
		//sim.AfficheMatrice();
		//Matrice.fusion(m, sim).AfficheMatrice();
		Simplification simp=new Simplification(sim);
		Fraction min=simp.Mini();
		//m.LigneUnify(1, 1);
		//m.AfficheMatrice();
		//simp.simplexe.afficheBase();
		System.out.println(min.toDouble());
		sim.AfficheMatrice();
		Vecteur.affiche(sim.getValeurs());
		
	}

}

